import request from '@/utils/request'
import { handlerGetUrlParams } from '@/utils/dealUrlParams.js'

// 获取课程列表
export function getCourse(params) {
    const url = handlerGetUrlParams(`/course/course/list`, params)
    return request({
        url,
        method: 'GET',
    })
}

export function getComment(params) {
    const url = handlerGetUrlParams("/evaluate/evaluate/list", params)
    return request({
        url,
        method: "GET"
    })
}

export function getlecturer(params) {
    const url = handlerGetUrlParams('/lecturer/lecturer/list', params)
    return request({
        url,
        method: "GET"
    })
}

export function submitComment(data) {
    return request({
        url: "/evaluate/evaluate",
        method: "POST",
        data
    })
}

export function subCollect(data) {
    return request({
        url: "/collect/collect",
        method: "POST",
        data
    })
}

export function canCollect(param) {
    return request({
        url: "/collect/collect/" + param,
        method: "DELETE",
        param
    })
}

export function getOrgById(param) {
    return request({
        url: "/organization/organization/" + param,
        method: "GET"
    })
}

export function getlecturerById(param) {
    return request({
        url: '/lecturer/lecturer/' + param,
        method: "GET"
    })
}

export function getCourseById(param) {
    return request({
        url: '/course/course/' + param,
        method: "GET"
    })
}

export function queryCollection(params) {
    const url = handlerGetUrlParams(`/collect/collect/list`, params)
    return request({
        url,
        method: 'GET',
    })
}